Flash memory apparatus and storage management method for flash memory

ABSTRACT

A flash memory method includes: classifying data into a plurality of groups of data; respectively executing error code encoding to generate first corresponding parity check code to store the groups of data and first corresponding parity check code into flash memory module as first blocks; reading out the groups of data from first blocks; executing error correction and de-randomize operation upon read out data to generate de-randomized data; executing randomize operation upon de-randomized data according to a set of seeds to generate randomized data; performing error code encoding upon randomized data to generate second corresponding parity check code; and, storing randomized data and second corresponding parity check code into flash memory module as second block; a cell of first block is used for storing data of first bit number which is different from second bit number corresponding to a cell of second block.

CROSS REFERENCE TO RELATED APPLICATIONS

This continuation application claims the benefit of U.S. applicationSer. No. 15/997,674, filed on Jun. 4, 2018, which is a continuationapplication of U.S. application Ser. No. 15/874,895, filed on Jan. 19,2018, which is a continuation-in-part of U.S. application Ser. No.15/497,185, filed on Apr. 25, 2017, which claims the benefits of U.S.provisional application Ser. No. 62/328,025 filed on Apr. 27, 2016,which is entirely incorporated herein by reference.

BACKGROUND OF THE INVENTION 1. Field of the Invention

The invention relates to a flash memory apparatus, and more particularlyto a flash memory apparatus and a corresponding storage managementmethod for performing RAID-like (Redundant Array of IndependentDisks-like) error correction code (ECC) encoding operation.

2. Description of the Prior Art

Generally speaking, when performing data programming to program datainto a single-level-cell (SLC) block or a multiple-level-cell (MLC)block, a conventional flash memory controller is usually arranged toprogram corresponding parity check codes of other data pages of a wordline of a data block into the last data page of the word line, so thatthe conventional controller can use the corresponding parity check codesto correct errors with a certain degree of error correction capabilitywhen program failure, word line open, or word line short occurs.However, the utilization rate of a flash memory space inevitably becomeslower. For example, if one word line includes eight data pages, theconventional controller is arranged to program data into seven datapages and program parity check codes into one data page. That is, it isnecessary to use one eighth of memory space of a data block for storingparity check codes. The one eighth of memory space cannot be used tostore data. This poor user experience is usually cannot be accepted forusers.

SUMMARY OF THE INVENTION

Therefore one of the objectives of the invention is to provide a flashmemory apparatus and corresponding flash memory storage managementmethod for adopting an RAID-like (Redundant Array of IndependentDisks-like) error code encoding operation, to reduce error rates, reducenumber of necessary parity check codes, and to appropriately program thenecessary parity check codes into corresponding memory locations of datapages, so as to be able to use the parity check codes to perform errorcorrection when program failure, word line open, and word line shortoccurs, to solve the problems mentioned above.

In addition, the invention is also to provide a process which classifiesdata to be programmed into a plurality of groups of data, respectivelyexecutes error code encoding to generate a corresponding parity checkcode to program the groups of data and the corresponding parity checkcode to a plurality of first blocks and then reads out and reprogramsdata read from the plurality of first blocks into at least one secondblock after completing program of the plurality of first blocks.

According to embodiments of the invention, a flash memory apparatus isdisclosed. The flash memory apparatus comprises a flash memory moduleand a flash memory controller. The flash memory module comprises aplurality of storage blocks, and a cell of each storage block can beused for storing data of 1 bit or data of at least 2 bits. The flashmemory controller is configured for classifying data to be programmedinto a plurality of groups of data, respectively executing error codeencoding to generate a first corresponding parity check code to storethe groups of data and the first corresponding parity check code intothe flash memory module as first blocks, reading out the groups of datafrom the first blocks, executing error correction and de-randomizeoperation upon read out data to generate de-randomized data, executingrandomize operation upon the de-randomized data according to a set ofseeds to generate randomized data, performing error code encoding uponthe randomized data to generate a second corresponding parity checkcode, and storing the randomized data and the second correspondingparity check code into the flash memory module as a second block. A cellof a first block is used for storing data of a first bit number which isdifferent from a second bit number, and a cell of the second block isarranged for storing data of the second bit number.

According to the embodiments, a flash memory storage management methodused for a flash memory module having a plurality of storage blocks isdisclosed. A cell of each storage block can be used for storing data of1 bit or data of at least 2 bits, and the flash memory storagemanagement method comprises: classifying data to be programmed into aplurality of groups of data; respectively executing error code encodingto generate a first corresponding parity check code to store the groupsof data and the first corresponding parity check code into the flashmemory module as first blocks; reading out the groups of data from thefirst blocks; executing error correction and de-randomize operation uponread out data to generate de-randomized data; executing randomizeoperation upon the de-randomized data according to a set of seeds togenerate randomized data; performing error code encoding upon therandomized data to generate a second corresponding parity check code;and storing the randomized data and the second corresponding paritycheck code into the flash memory module as a second block. A cell of afirst block is used for storing data of a first bit number which isdifferent from a second bit number, and a cell of the second block isarranged for storing data of the second bit number.

According to the embodiments, a flash memory controller connected to aflash memory module having a plurality of storage blocks is disclosed. Acell of each storage block can be used for storing data of 1 bit or dataof at least 2 bits. The flash memory controller is configured forclassifying data to be programmed into a plurality of groups of data,respectively executing error code encoding to generate a firstcorresponding parity check code to store the groups of data and thefirst corresponding parity check code into the flash memory module asfirst blocks. The flash memory controller comprises a decoding circuit,a de-randomizer, a randomizer, and an encoding circuit. The decodingcircuit is configured for executing error correction upon read out datawhich is read out by the flash memory controller from the first blocks.The de-randomizer is coupled to the decoding circuit and configured forperforming a de-randomize operation upon the read out data to generatede-randomized data. The randomizer is coupled to the de-randomizer andconfigured for executing a randomize operation upon the de-randomizeddata according to a set of seeds to generate randomized data. Theencoding circuit is coupled to the randomizer and configured forperforming the error code encoding upon the randomized data to generatea second corresponding parity check code. The flash memory controller isarranged for storing the randomized data and the second correspondingparity check code into the flash memory module as a second block. A cellof a first block is used for storing data of a first bit number which isdifferent from a second bit number, and a cell of the second block isarranged for storing data of the second bit number.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment that isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a device diagram of a flash memory apparatus according to anembodiment of the invention.

FIG. 2 is a diagram illustrating one SLC programming executed by theflash memory controller of FIG. 1 to program a particular group of datainto an SLC block of flash memory module according to a first embodimentof the invention.

FIG. 3 is a diagram illustrating data programming from one SLC blockwithin flash memory module to the TLC block via the internal copyoperation.

FIG. 4 is a diagram illustrating an embodiment of flash memorycontroller in FIG. 1 programming/writing three groups of data intomultiple SLC blocks within flash memory module and moving the data intothe TLC block via the internal copy operation to form a super block.

FIG. 5 is a diagram illustrating one SLC programming executed by theflash memory controller of FIG. 1 to program a particular group of datainto an SLC block of flash memory module according to a secondembodiment of the invention.

FIG. 6 is a diagram illustrating a second embodiment of flash memorycontroller in FIG. 1 programming/writing three groups of data intomultiple SLC blocks within flash memory module and moving the data intothe TLC block via the internal copy operation to form a super block.

FIG. 7 is a timing diagram showing a command sequence sent from theflash memory controller to the flash memory module according to a firstcommand sequence embodiment of the invention.

FIG. 8 is a timing diagram showing a command sequence sent from theflash memory controller to the flash memory module according to a secondcommand sequence embodiment of the invention.

FIG. 9 is a timing diagram showing a command sequence sent from theflash memory controller to the flash memory module according to a thirdcommand sequence embodiment of the invention.

FIG. 10 is a device diagram of the flash memory apparatus according toanother embodiment of the invention.

FIG. 11 is a diagram of a 3D NAND-type flash memory.

FIG. 12 is a schematic diagram illustrating floating gate transistors.

FIG. 13 is a diagram illustrating multiple word line sets in one block.

DETAILED DESCRIPTION

Please refer to FIG. 1, which is a device diagram of a flash memoryapparatus 100 according to an embodiment of the invention. The flashmemory apparatus 100 comprises a flash memory module 105 and a flashmemory controller 110. The flash memory module 105 is a flash memorymodule having a two-dimensional plane structure; however, this is notmeant to be a limitation of the invention. The flash memory module 105comprises multiple flash memory chips (not shown in FIG. 1) and eachflash memory chip includes multiple storage blocks wherein the storageblock(s) may be used as first block(s) or second block(s). A cell/unitof a first block is arranged for storing data of 1 bit (i.e. two statesof one bit), and a cell/unit of a second block is arranged for storingdata of N bits, i.e., 2^(N) states, wherein N is an integer equal to orgreater than 1. In one embodiment, the first block may be used as asingle-level-cell (SLC) block, and the second block may be used as amultiple-level-cell block. The multiple-level-cell block for exampleincludes units of a multi-level cell (MLC) block which can be used forstoring data of 2 bits (i.e. 4 states), units of a triple-level cell(TLC) block which can be used for storing data of 3 bits (i.e. 8states), and/or units of a quad-level cell (QLC) block which can be usedfor storing data of 4 bits (16 states), and so on. Typically, the memorycells in the flash memory module 105 have the same or similar physicalstructure. The memory cells can be arranged as SLC, MLC, or TLC blocksunder the control of the flash memory controller 110. The followingdescriptions mainly illustrate the SLC, MLC, or TLC blocks for brevity.Please note that the flash memory controller 110 can arrange a part ofthe memory cells in a block as SLC cells and a part of the memory cellsin the same block as MLC cells (or TLC cells). It is not a limitation toarrange all cells of a block as the same cell (e.g. all SLC cells).

The flash memory controller 110 can be arranged to employ various kindsof programming schemes to control and program a storage block as thefirst block (e.g. so called SLC block) having cells each for storingdata of two states of one bit or as the second block (e.g. so called MLCblock or TLC block) having cells each for storing data of 2^(N) statesof N bits. Corresponding embodiments are detailed in the followingparagraphs.

Refer to FIG. 7. FIG. 7 is a timing diagram showing a command sequencesent from the flash memory controller 110 to the flash memory module 105according to a first command sequence embodiment of the invention. Asshown in FIG. 7, when the flash memory controller 110 determines tocontrol one or more blocks within flash memory module 105 as firstblocks(s) such as SLC block(s) having cells for storing data of twostates of 1 bit (i.e. bits ‘0’ and ‘1’), the flash memory controller 110is arranged to send a SET FEATURES (‘EFh’) command sequence to themodule 105. For example, the flash memory controller 110 maysequentially send the SET FEATURES command ‘EFh’, the address ‘ADDR’ ofa control register within a chip/die of the module 105, and the valuesto be written into the control register ‘01h’, ‘00h’, ‘00h’, ‘00h’(total 32 bytes but not limited), so as to enable SLC programmingoperation; the address ‘ADDR’ of the control register may be ‘91h’ (butnot limited). That is, after this, such chip/die equivalently enters anSLC mode/state, and the flash memory controller 110 can treat one ormore blocks of such chip/die as SLC block(s) and perform SLC programmingupon such SLC block(s) if such chip/die does not exit the SLCmode/state.

Alternatively, when the flash memory controller 110 determines tocontrol one or more blocks within flash memory module 105 as secondblocks(s) such as multi-level-cell (MLC) block(s) having cells forstoring data of 4 states of 2 bits (i.e. bits ‘00’, ‘01’, ‘10’, ‘11’),the flash memory controller 110 is also arranged to send the SETFEATURES (‘EFh’) command sequence to the module 105. For example, theflash memory controller 110 may sequentially send the SET FEATUREScommand ‘EFh’, the address of the control register within the chip/dieof the module 105, the values to be written into the control register‘02h’, ‘00h’, ‘00h’, ‘00h’ (total 32 bytes but not limited), so as toenable MLC programming operation. That is, after this, such chip/dieequivalently enters an MLC mode/state, and the flash memory controller110 can treat one or more blocks of such chip/die as MLC block(s) andperform MLC programming upon such MLC block(s) if such chip/die does notexit the MLC mode/state.

Alternatively, when the flash memory controller 110 determines tocontrol one or more blocks within flash memory module 105 as secondblocks(s) such as TLC block(s) having cells for storing data of 2³states of 3 bits (i.e. bits ‘000’, ‘001’, ‘010’, ‘011’, ‘100’, ‘101’,‘110’, and ‘111’), the flash memory controller 110 is also arranged tosend the SET FEATURES (‘EFh’) command sequence to the module 105. Forexample, the flash memory controller 110 may sequentially send the SETFEATURES command ‘EFh’, the address of the control register within thechip/die of the module 105, the values to be written into the controlregister ‘04h’, ‘00h’, ‘00h’, ‘00h’ (total 32 bytes but not limited), soas to enable TLC programming operation. That is, after this, suchchip/die equivalently enters a TLC mode/state, and the flash memorycontroller 110 can treat one or more blocks of such chip/die as TLCblock(s) and perform TLC programming upon such MLC block(s) if suchchip/die does not exit the TLC mode/state.

Refer to FIG. 8. FIG. 8 is a timing diagram showing a command sequencesent from the flash memory controller 110 to the flash memory module 105according to a second command sequence embodiment of the invention. Thedefault setting is that the flash memory controller 110 treats a blockas the second block (i.e. the multiple-level-cell block) such as a TLCblock and programs data into such TLC block. In this situation, theflash memory controller 110 is arranged to sequentially send the startof programming command ‘80h’ (8 bytes), information of the address to beprogramed which is indicated by C1, C2, R1, R2, R3 (total 40 bytes butnot limited), data to be programed ‘W-Data’, and the end of programmingcommand ‘10h’ (8 bytes). If receiving this kind of command sequence, theflash memory module 105 knows that such block is programmed as a TLCblock, e.g. the blocks 1052.

Alternatively, when the flash memory controller 110 determines to use ablock within flash memory module 105 as a first block such as an SLCblock, the flash memory controller 110 is arranged to send a specificcommand/prefix such as ‘A2h’ (8 bytes) before sending the start ofprogramming command ‘80h’. That is, the flash memory controller 110 isarranged to sequentially send the specific command/prefix ‘A2h’, thestart of programming command ‘80h’ (8 bytes), information of the addressto be programed which is indicated by C1, C2, R1, R2, R3 (total 40 bytesbut not limited), data to be programed ‘W-Data’, and the end ofprogramming command ‘10h’ (8 bytes). If receiving this kind of commandsequence, the flash memory module 105 knows that such block isprogrammed as an SLC block, e.g. the blocks 1051A, 1051B, and 1051C. Inother words, in this embodiment, the flash memory controller 110 isarranged to further send the specific command ‘A2h’ each time beforesending the start of programming command ‘80h’ to notify the module 105to program a block which is used as the SLC block. The flash memorycontroller 110 does not send the specific command ‘A2h’ if thecontroller 110 is arranged to notify the module 105 to program a blockwhich is used as the TLC block. In addition, it should be noted that thespecific command ‘A2h’ is similarly used in reading a block used as theSLC block and/or erasing the SLC block. In addition, it should be notedthat in other embodiments the specific command/prefix ‘A2h’ may beplaced in the middle between ‘80h’ and ‘10h’ to notify the module 105 ofa block will be programmed as an SLC block.

Refer to FIG. 9. FIG. 9 is a timing diagram showing a command sequencesent from the flash memory controller 110 to the flash memory module 105according to a third command sequence embodiment of the invention. Thedefault setting is that the flash memory controller 110 treats a blockas the second block (i.e. the multiple-level-cell block) such as a TLCblock and programs data into such TLC block. The flash memory controller110 can be arranged to send a specific command/prefix ‘DAh’ to enableSLC mode programming of a block and send another command/prefix ‘DFh’ todisable SLC mode programming of a block. The command/prefix ‘DAh’ can beplaced/added in the front of an erase command, a read command, or aprogramming command, and the command/prefix ‘DFh’ can be placed/added inthe front of an erase command, a read command, or a programming command.

For example, when the flash memory controller 110 determines to use ablock within flash memory module 105 as a first block such as an SLCblock as well as performs programming, the flash memory controller 110is arranged to sequentially send the specific command/prefix ‘DAh’, thestart of programming command ‘80h’ (8 bytes), information of the addressto be programed which is indicated by R1-R5 (total 40 bytes but notlimited), the data to be programed ‘W-Data’, and the end of programmingcommand ‘10h’ (8 bytes). After this, the flash memory module 105equivalently enters an SLC mode, and the controller 110 treats block(s)of flash memory module 105 as SLC block(s) and performs SLC programmingupon such blocks if the module 105 does not exit the SLC mode.Additionally, for example, the flash memory controller 110 can bearranged to perform a block erase operation with SLC mode enableoperation by sequentially sending the specific command/prefix ‘DAh’, thestart of erase command ‘60h’, information of the address to be erasedprogramed which is indicated by R1-R3, and the end of erase command‘D0h’. After this erase operation, the flash memory module 105equivalently enters the SLC mode, and the controller 110 treats block(s)of flash memory module 105 as SLC block(s) and performs SLC programmingupon such blocks if the module 105 does not exit the SLC mode. Further,for example, the flash memory controller 110 can be arranged to performan SLC page read operation by sequentially sending the specificcommand/prefix ‘DAh’, the start of read command ‘00h’, information ofthe address to be read which is indicated by C1, C2, R1-R3, and the endof read command ‘30h’.

Alternatively, when the flash memory controller 110 determines to useblock(s) within flash memory module 105 as second block(s) such as TLCblock(s), the flash memory controller 110 is arranged to send thecommand/prefix ‘DFh’ to disable SLC programming. For example, the flashmemory controller 110 is arranged to sequentially send the specificcommand/prefix ‘DFh’, the start of programming command ‘80h’ (8 bytes),information of the address to be programed which is indicated by R1-R5(total 40 bytes but not limited), and the end of programming command‘10h’ (8 bytes). After this, the flash memory module 105 equivalentlyenters a TLC mode, and the controller 110 treats block(s) of flashmemory module 105 as TLC block(s) and performs TLC programming upon suchblocks if the module 105 does not exit the TLC mode. Additionally, forexample, the flash memory controller 110 can be arranged to perform ablock erase operation with TLC mode enable operation by sequentiallysending the specific command/prefix ‘DFh’, the start of erase command‘60h’, information of the address to be erased programed which isindicated by R1-R3, and the end of erase command ‘D0h’. After this eraseoperation, the flash memory module 105 equivalently enters the TLC mode,and the controller 110 treats block(s) of flash memory module 105 as TLCblock(s) and performs SLC programming upon such blocks if the module 105does not exit the TLC mode. Further, for example, the flash memorycontroller 110 can be arranged to perform a TLC page read operation bysequentially sending the specific command/prefix ‘DFh’, the start ofread command ‘00h’, information of the address to be read which isindicated by C1, C2, R1-R3, and the end of read command ‘30h’.

The flash memory controller 110 is connected to the flash memory module105 via a plurality of channels. The flash memory controller 110 can usethe different channels to simultaneously program data into differentflash memory chips to improve the efficiency of data programming. Theflash memory controller 110 includes an error correction code (ECC)encoding circuit 1101 and a parity check code buffer 1102. The ECCencoding circuit 1101 is arranged to perform ECC encoding operation upondata. For example, in the embodiments, the ECC encoding operationcomprises Reed-Solomon (RS) codes encoding operation and/or exclusive-OR(XOR) encoding operation for generating corresponding parity check codesrespectively. The parity check code buffer 1102 is used for temporarilystoring the generated corresponding parity check codes. The flash memorycontroller 110 is arranged for programming data into different flashmemory chips by employing an RAID-like (Redundant Array of IndependentDisks-like) memory management mechanism to reduce data error rate andreferring to storage locations (storage locations of SLC block(s) andstorage locations of TLC block(s)) of parity check codes generated bydifferent encoding operations when programming data into SLC block (s)so that data errors can be corrected when programming data into SLCblock(s) and also can be corrected when the flash memory module 105performs an internal copy operation to copy and move data from SLCblock(s) to a TLC block.

In practice, in order to improve the efficiency of data programming andreduce the data error rate, the flash memory module 105 is designed toinclude multiple channels (for example two channels in this embodimentbut is not limited). When a channel is used by the controller 110 toprogram a certain data page, the controller 110 can use another channelto program another data page without waiting for the former channel.Each channel corresponds to respective sequencer in the controller 110and corresponds to multiple flash memory chips (for example two chips inthis embodiment but is not limited). Thus, one channel can be to performdata programming simultaneously for different data pages of multipleflash memory chips without waiting for completion of one chip. Inaddition, each flash memory chip includes a folded design including twodifferent planes, and different data pages of two blocks respectivelylocated on the two different planes can be programmed simultaneouslywithout waiting for completion of data programming of one block whenprogramming data into one flash memory chip. One super block of theflash memory module 105 is composed by multiple data pages of multipleflash memory chips of multiple channels. The flash memory controller 110is arranged to program data by super blocks. The flash memory controller110 programs data to SLC blocks within the flash memory module 105, andthe programmed data are buffered by the SLC blocks. Then, the programmeddata is copied and programmed to a TLC block from the SLC blocks. Itshould be noted that in other embodiments each flash memory chip may notcomprise the folded design, and one data page of one block is programmedwhen programming data into one flash memory chip. It is required to waitfor some times for programming data to other data pages.

For the flow of data programming, data is programmed by the flash memorycontroller 110 to multiple SLC blocks 1051A-1051C, and then theprogrammed data is moved from the SLC blocks 1051A-1051C to themultiple-level-cell block 1052 such as the TLC block including TLC unitsfor storing information of 2³ states of 3 bits in this embodiment; theprogramed data is moved into the buffer 1053 and then is moved from thebuffer 1053 to the multiple-level-cell block 1052 such as TLC block, andcommands of the data move operations can be issued by the flash memorycontroller 110. That is, data of the three SLC blocks 1051A-1051C isprogrammed into one TLC block 1052. To perform error correctionprotection for data programming of SLC blocks 1051A-1051C and dataprogramming of the TLC block 1052, the flash memory controller 110 isarranged for classifying the data into three groups of data. It shouldbe noted that the flash memory controller 110 is arranged forclassifying the data into two groups of data if the multiple-level-cellblock for example includes MLC units which can be used for storing dataof 2² states of 2 bits. The flash memory controller 110 is arranged forclassifying the data into four groups of data if the multiple-level-cellblock for example includes QLC units which can be used for storing dataof 2⁴ states of 4 bits. That is, the units of multiple-level-cell block1052 are used for storing information of 2^(N) states of N bits whereinN is an integer which is equal to or greater than 2, and the number ofSLC blocks is designed as N. The flash memory controller 110 is arrangedto classify data to be programmed into N groups of data to respectivelyprogram the data into N SLC blocks.

In this embodiment, after classifying the data as three groups of data,the flash memory controller 110 is arranged to execute a first SLCprogram to program the first group of data into the first SLC block1051A and use the ECC coding circuit 1101 to generate correspondingparity check codes and write the corresponding parity check codes intothe first SLC block 1051A. In this way, the data program of the SLCblock 1051A is completed. Then, the flash memory controller 110 isarranged to execute the second SLC program to program the second groupof data into the second SLC block 1051B and use the ECC coding circuit1101 to generate corresponding parity check codes and write thecorresponding parity check codes into the second SLC block 1051B. Inthis way, the data program of the SLC block 1051B is completed. Theflash memory controller 110 then is arranged to execute the third SLCprogram to program the third group of data into the third SLC block1051C and use the ECC coding circuit 1101 to generate correspondingparity check codes and write the corresponding parity check codes intothe third SLC block 1051C. In this way, the data program of the thirdSLC block 1051C is completed.

When the flash memory controller 110 performs SLC program to write aparticular group of data into a particular SLC block or afterprogramming the particular SLC block has been completed, the flashmemory controller 110 is arranged to detect whether there are dataerrors. If data errors exist, for example program fail, one word lineopen, and/or two word line short occurs when programming a particularSLC block, the flash memory controller 110 is arranged for correctingthe data errors by using corresponding parity check codes generated bythe ECC encoding circuit 1101 when programming the particular SLC block.

When programming the above three groups of data into the three SLCblocks 1051A-1051C or programming a particular SLC block has beencompleted, the flash memory module 105 is arranged for performinginternal copy operation by copying and moving the three groups of datafrom the three SLC blocks 1051A-1051C to the TLC block 1052 or copyingand moving the particular group of data from the particular SLC block tothe TLC block 1052 and then performing TLC programming to write the datainto the TLC block 1052 (i.e. the above-mentioned super block) accordingto the order of the three groups of data. The TLC block 1052 is composedby data pages of word lines of different flash memory chips of differentchannels. A data page of a word line of the TLC block 1052 for exampleincludes an upper page, a middle page, and a lower page. The internalcopy operation of flash memory module 105 for example is used toprogram/write multiple data pages of the (N)th word line of an SLC blockinto multiple upper pages of a word line of the TLC block 1052, toprogram/write multiple data pages of the (N+1)th word line of the SLCblock into multiple middle pages of the same word line of the TLC block1052, and to program/write multiple data pages of the (N+2)th word lineof the SLC block into multiple lower pages of the same word line of theTLC block 1052, sequentially. After all the three groups of data havebeen programed into the TLC block 1052, the program operation for thesuper block is completed.

It should be noted that, to easily implement the internal copyoperation, meet the requirement of randomizer seed rules of TLC block1052, and reduce the data error rate according to the ECC encodingcapability, the internal copy operation is arranged to move data fromSLC blocks into locations of upper, middle, and lower pages of multipleword lines if the TLC block 1052 according to the order of the data, andthe flash memory controller 110 is arranged to program/write thedifferent groups of data and generated corresponding parity check codesinto the SLC blocks 1051A-1051C according to the requirement ofrandomizer seed rules of TLC block 1052 and storage locations of paritycheck codes of ECC encoding. Thus, the ECC capability of ECC encodingcircuit 1101 can be arranged to correct the errors which are resultedfrom program failure, one word line open and/or two word line short ofan SLC block when programming the SLC block, and can be also arranged tocorrect the errors which are resulted from program failure, one wordline open and/or two word line short of TLC block 1052 when programmingthe TLC block 1052.

In addition, if the flash memory module 105 performs memory garbagecollection, the flash memory controller 110 can externally read out andretrieve data from the SLC blocks 1051A-1051C and/or from the TLC block1052 to re-perform ECC encoding to execute SLC programming again. Inaddition, if performing SLC programming to write data into an SLC blockand shutdown occurs, the flash memory controller 110 is arranged to readback data from the SLC block and re-encode and re-perform ECC encodingand SLC programming the read back data into another SLC block. Inaddition, if performing TLC programming to write data into the TLC block1052 and shutdown occurs, the flash memory module 105 is arranged todiscard data currently stored by the TLC block 1052 and perform theinternal copy operation to copy and program corresponding data from theSLC blocks 1051A-1051C into TLC block 1052

Please refer to FIG. 2, which is a diagram illustrating one SLCprogramming executed by the flash memory controller 110 of FIG. 1 toprogram a particular group of data into an SLC block of flash memorymodule 105 according to a first embodiment of the invention. The ECCencoding circuit 1101 of flash memory controller 110 is arranged toperform RAID-like RS (Reed Solomon) encoding operation upon data togenerate corresponding parity check codes, and the parity check codebuffer 1102 is used for temporarily storing the generated parity checkcodes.

The flash memory module 105 includes two channels and two flash memorychips in which two sets of blocks of each chip include two differentplanes. To improve the efficiency of data programming, the flash memorycontroller 110 is arranged for respectively programming/writing data viathe two channels into two different blocks of the two flash memory chipswithin flash memory module 105. As shown in FIG. 2, in this embodiment,one SLC block for example includes (128) word lines which arerespectively represented by WL0-WL127. The SLC block can be composed byonly one SLC block or one set of sub-blocks of the SLC block, anddepends on different definitions of SLC block in different embodiments.In this embodiment, one SLC block is composed by a set of (128) wordlines each for example including (8) data pages. For the first word lineWL0 of the SLC block, the flash memory controller 110 programs/writesthe data pages P1 and P2 into the flash memory chip CE0 via channel CH0and folded planes PLN0 and PLN1, then programs/writes the data pages P3and P4 into another flash memory chip CE1 via the same channel CH0 andfolded planes PLN0 and PLN1, then programs/writes the data pages P5 andP6 into the flash memory chip CE0 via another channel CH1 and foldedplanes PLN0 and PLN1, and then programs/writes the data pages P7 and P8into the flash memory chip CE1 via the channel CH1 and folded planesPLN0 and PLN1; other and so on.

The flash memory controller 110 sequentially classifies every (M) wordlines among the multiple word lines WL0-WL127 of an SLC block as onegroup of data wherein the number (M) is an integer which is equal to orgreater than two. For example, M is equal to three. Word lines WL0-WL2are classified into the first group of data. Word lines WL3-WL5 areclassified into the second group of data. Word lines WL6-WL8 areclassified into the third group of data. Word lines WL9-WL11 areclassified into the fourth group of data, and other so on. Word linesWL120-WL122 are classified into a third group of data which is inverselycounted, i.e. an antepenult group. Word lines WL123-WL125 are classifiedinto a second group of data which is inversely counted, i.e. apenultimate group. Word lines WL126-WL127 are classified into thelast/final group of data. The first, third, fifth groups of word linesand so on are odd groups of word lines, and the second, fourth, sixthgroups of word lines and so on are even groups of word lines. When eachtime programming/writing one group of word line data (including data ofthree word lines), the flash memory controller 110 is arranged to usethe ECC encoding circuit 1101 to execute ECC encoding upon the group ofword line data to generate and output corresponding partial parity checkcodes to the parity check code buffer 1102 for buffering the partialparity check codes.

For buffering the partial parity check codes, the parity check codebuffer 1102 is arranged to store partial parity check codescorresponding to odd groups of word line data in a first buffer area1102A and to store partial parity check codes corresponding to evengroups of word line data in a second buffer area 1102B. For example,when programming/writing data pages P1-P24 of word lines WL0-WL2, theECC encoding circuit 1101 performs ECC encoding upon data of the datapages P1-P24 and then outputs generated partial parity check codes tothe parity check code buffer 1102 and buffer the generated partialparity check codes in the first buffer area 1102A. Whenprogramming/writing data pages P1-P24 of word lines WL3-WL5, the ECCencoding circuit 1101 performs ECC encoding upon data of the data pagesP1-P24 and then outputs generated partial parity check codes to theparity check code buffer 1102 and buffer the generated partial paritycheck codes in the second buffer area 1102B. When programming/writingdata pages P25-P48 of word lines WL6-WL8, the ECC encoding circuit 1101performs ECC encoding upon data of the data pages P25-P48 and thenoutputs generated partial parity check codes to the parity check codebuffer 1102 and buffer the generated partial parity check codes in thefirst buffer area 1102A. The ECC encoding operation and buffer operationare performed similarly for other data pages. When programming/writingdata pages of word lines WL120-WL122, the ECC encoding circuit 1101performs ECC encoding upon data of the data pages of word linesWL120-WL122 and then outputs generated partial parity check codes to theparity check code buffer 1102 and buffer the generated partial paritycheck codes in the first buffer area 1102A.

When programming/writing the last group of word lines (WL123-WL125)among even groups of word lines, in addition to performing SLCprogramming and corresponding ECC encoding operation, the flash memorycontroller 110 is also arranged to read back partial parity check codescorresponding to all data of even groups of word lines data buffered bythe second buffer area 1102B, and to write/program all parity checkcodes (all partial parity check codes) corresponding to even groups ofword line data into data pages of the last word line WL125 of the lastgroup of word lines among the even groups of word lines. For instance,the all partial parity check codes, i.e. RS parity check codescorresponding to data of even groups of word lines, are programmed tothe last three data pages as marked by 205 on FIG. 2.

Additionally, in addition to performing SLC programming andcorresponding ECC encoding operation, when programming the last wordline WL127 of the last group among the odd groups of data, the flashmemory controller 110 is arranged to read back partial parity checkcodes corresponding to all odd groups of data, i.e. a portion of allparity check codes, from the first buffer area 1102A. The flash memorycontroller 110 then programs/writes all parity check codes correspondingto the odd groups of data into the data pages such as the last threedata pages marked by 210 of the last word line WL127 of the last oddgroup of word lines, to store RS parity check codes corresponding todata of all the odd groups of word lines. After this, programming forone SLC block is completed. With respect to RS encoding operation, theparity check codes corresponding to data of the odd groups of word linesare stored/programed to the last data pages of the last word line WL127of the last group among the odd groups of word lines. The parity checkcodes corresponding to data of the even groups of word lines arestored/programed to the last data pages of the last word line WL125 ofthe last group among the even groups of word lines.

In addition, as shown by the embodiment of FIG. 2, the ECC encodingcircuit 1101 performs the ECC encoding operation such as an RS codeencoding operation capable of correcting error(s) of any three datapages of one SLC block. For example, the ECC encoding circuit 1101performs the ECC encoding operation upon data of the three word linesWL0-WL2 to generate corresponding partial parity check codes. If dataerrors result from three data pages, e.g. data pages P1, P9, and P17, ofthe same folded plane of the same chip of the same channel, the ECCencoding circuit 1101 can use the generated partial parity check codesto correct data errors of the three data pages.

The flash memory controller 110 may detect program fail whenprogramming/writing one SLC block. For example, if the controller 110detects program fail of a data page such as P9, the ECC encoding circuit1101 can use corresponding partial parity check codes to correct errorsof the data page P9.

The flash memory controller 110 may detect one word line open whenprogramming/writing one SLC block. For example, if the controller 110detects one word line open of a data page such as P9, the ECC encodingcircuit 1101 can use the corresponding partial parity check codes tocorrect errors of the data page P9.

The flash memory controller 110 may detect two word line short whenprogramming/writing one SLC block. For example, if the controller 110detects data errors of two data pages such as P9 and P17 resulting fromtwo word line short of the two data pages, the ECC encoding circuit 1101can use the corresponding partial parity check codes to correct errorsof the two data pages P9 and P17. If the controller 110 detects dataerrors of two data pages such as P17 of word line WL2 and P1 of the wordline WL3 resulting from two word line short of the two data pages, theECC encoding circuit 1101 can use partial parity check codes of onegroup of word lines WL0-WL2 and partial parity check codes of anothergroup of word lines WL3-WL5 to respectively correct data errors of pageP17 of word line WL2 and page P1 of word line WL3. If the controller 110detects data errors of two data pages such as P1 and P2 of word line WL0resulting from two word line short of the two data pages, the ECCencoding circuit 1101 can use partial parity check codes of one group ofword lines WL0-WL2 to respectively correct data errors of pages P1 andP2 of word line WL0.

Therefore, the ECC encoding circuit 1101 can correspondingly correctdata page errors resulting from program fail, one word line open or twoword line short when performing programming of one SLC block.

Please refer to FIG. 3, which is a diagram illustrating data programmingfrom one SLC block within flash memory module 105 to the TLC block 1052via the internal copy operation. As shown by FIG. 3, data of a group ofthree word lines within one SLC block is programed to one word linewithin TLC block 1052, to correspondingly form a least important bit(LSB) portion, a central important bit (CSB) portion, and a mostimportant bit (MSB) portion of one data page of the word line within TLCblock 1052. For instance, data of word lines WL0-WL2 of the SLC block isrespectively programed to the LSB portion, CSB portion, and MSB portionof word line WL0 of TLC block 1052. Data of word lines WL3-WL5 of theSLC block is respectively programed to the LSB portion, CSB portion, andMSB portion of word line WL1 of TLC block 1052. Data of word linesWL6-WL8 of the SLC block is respectively programed to the LSB portion,CSB portion, and MSB portion of word line WL2 of TLC block 1052. Thatis, the internal copy operation of flash memory module 105 is used tomove and program data of one SLC block into partial word lines of theTLC block by the sequence of word lines of the SLC block.

Please refer to FIG. 4, which is a diagram illustrating an embodiment offlash memory controller 110 in FIG. 1 programming/writing three groupsof data into multiple SLC blocks 1051A-1051C within flash memory module105 and moving the data into the TLC block via the internal copyoperation to form a super block. The ECC encoding circuit 1101 isarranged to separate data into odd groups of word line data and evengroups of word line data each time when performing programming of SLCblock(s), and is arranged to respectively store generated parity checkcodes at the last three data pages of the last word line of the oddgroups of word lines and the last three data pages of the last word lineof the even groups of word lines. When module 105 performs programmingof TLC block, as shown in FIG. 4, the parity check codes correspondingto the first group among the odd groups of word lines are programed andstored to the last three data pages, marked by 401A, of the CSB portionsof word line WL42 of the super block. The parity check codescorresponding to the first group among the even groups of word lines areprogramed and stored to the last three data pages, marked by 401B, ofthe MSB portions of word line WL41 of the super block. The parity checkcodes corresponding to the second group among the odd groups of wordlines are programed and stored to the last three data pages (marked by402A) of the LSB portions of word line WL85 of the super block. Theparity check codes corresponding to the second group among the evengroups of word lines are programed and stored to the last three datapages, marked by 402B, of the MSB portions of word line WL84 of thesuper block. The parity check codes corresponding to the third groupamong the odd groups of word lines are programed and stored to the lastthree data pages, marked by 403A, of the MSB portions of word line WL127of the super block. The parity check codes corresponding to the thirdgroup among the even groups of word lines are programed and stored tothe last three data pages, marked by 403B, of the LSB portions of wordline WL127 of the super block.

If detecting data errors resulting from two word line short andoccurring at two data pages (marked by 404) of word lines WL0 and WL1 ofthe super block, the flash memory module 105 is capable of correctingthe errors occurring at the data page of word line WL0 by using theparity check codes 401A stored at the three data pages of the CSBportions of word line WL42, and is also capable of correcting the errorsoccurring at the data page of word line WL1 by using the parity checkcodes 401B stored at the three data pages of the MSB portions of wordline WL41.

Similarly, if detecting data errors resulting from two word line shortand occurring at two data pages (marked by 405) of word lines WL43 andWL44 of the super block, the flash memory module 105 is capable ofcorrecting the errors occurring at the LSB and CSB portions of one datapage of word line WL43 and MSB portion of one data page of word lineWL44 (as marked by 405) by using the parity check codes 402A stored atthe LSB portions of the last three data pages of word line WL85, and isalso capable of correcting the errors occurring at the MSB portion ofone data page of word line WL 43 and LSB and CSB portions of one datapage of word line WL44 (as marked by 405) by using the parity checkcodes 402B stored at the CSB portions of the last three data pages ofword line WL84.

Similarly, if detecting data errors resulting from two word line shortand occurring at two data pages (marked by 406) of word lines WL125 andWL126 of the TLC block, the flash memory module 105 is capable ofcorrecting the errors occurring at the CSB and MSB portions of one datapage of word line WL125 and MSB portion of one data page of word lineWL126 (as marked by 406) by using the parity check codes 403A stored atthe MSB portions of the last three data pages of word line WL127, and isalso capable of correcting the errors occurring at the LSB portion ofone data page of word line WL125 and CSB and MSB portions of one datapage of word line WL126 (as marked by 406) by using the parity checkcodes 403B stored at the LSB portions of the last three data pages ofword line WL127.

If detecting data errors resulting from one word line open or programfail and occurring at any one data page of any one word line of thesuper block (i.e. errors occurring at any three consecutive subpages),the flash memory module 105 is also capable of correcting errorsoccurring at any three consecutive subpages by using correspondingparity check codes.

According to the storage management mechanism for using flash memorycontroller 110 to program/write three groups of data and correspondingparity check codes into SLC blocks 1051A-1051C within flash memorymodule 105, when the flash memory module 105 uses the internal copyoperation to sequentially program/write the data from SLC blocks1051A-1051C into the TLC block to form a super block, the flash memorymodule 105 can perform error correction by using the parity check codesstored at the SLC blocks 1051A-1051C if detecting the errors resultingfrom one word line open, two word line short or program fail.

Please refer to FIG. 5, which is a diagram illustrating one SLCprogramming executed by the flash memory controller 110 of FIG. 1 toprogram a particular group of data into an SLC block of flash memorymodule 105 according to a second embodiment of the invention. The ECCencoding circuit 1101 of flash memory controller 110 is arranged toperform RAID-like XOR (exclusive-OR) encoding operation upon data togenerate corresponding parity check codes, and the parity check codebuffer 1102 is used for temporarily storing the generated parity checkcodes. In addition, the XOR operation of ECC encoding circuit 1101includes three different encoding engines to respectively perform XORoperations upon different word line data of SLC block(s). Thedescription is detailed in the following paragraphs.

The flash memory module 105 includes two channels and two flash memorychips. To improve the efficiency of data programming, the flash memorycontroller 110 is arranged for respectively programming/writing data viathe two channels into the two flash memory chips within flash memorymodule 105, to respectively program data pages of one SLC block intodifferent flash memory chips. In this embodiment, an SLC block of oneSLC block data programming executed by flash memory controller 110 forexample includes (128) word lines which are respectively represented byWL0-WL127. Each word line includes/has eight data pages. For example,regarding word line WL0, the ECC encoding circuit 1101 programs/writesdata pages P1 and P2 into flash memory chip CE0 by using the channel CH0and planes PLN0 and PLN1, and then programs/writes data pages P3 and P4into another flash memory chip CE1 by using the same channel CH0 andplanes PLN0 and PLN1. The ECC encoding circuit 1101 then programs/writesdata pages P5 and P6 into flash memory chip CE0 by using the channel CH1and planes PLN0 and PLN1, and programs/writes data pages P7 and P8 intoanother flash memory chip CE1 by using the channel CH1 and planes PLN0and PLN1; other and so on.

The ECC encoding circuit 1101 of flash memory controller 110sequentially classifies every (M) word lines among the multiple wordlines WL0-WL127 of an SLC block into one group of word lines wherein thenumber (M) is an integer which is equal to or greater than two. Forexample, M is equal to three. For example, word lines WL0-WL2 areclassified into the first group. Word lines WL3-WL5 are classified intothe second group. Word lines WL6-WL8 are classified into the thirdgroup. Word lines WL9-WL11 are classified into the fourth group, andother so on. Word lines WL120-WL122 are classified into a third groupwhich is inversely counted, i.e. an antepenult group. Word linesWL123-WL125 are classified into a second group which is inverselycounted, i.e. a penultimate group. Word lines WL126-WL127 are classifiedinto the final group (the last group). The first, third, fifth groupsand so on are odd groups of word lines, and the second, fourth, sixthgroups and so on are even groups of word lines. When each timeprogramming/writing one group of word line data (including data of threeword lines), the flash memory controller 110 is arranged to use the ECCencoding circuit 1101 to execute/perform ECC encoding operation uponsuch group of word line data to generate and output correspondingpartial parity check codes to the parity check code buffer 1102 forbuffering the partial parity check codes.

When each time programming/writing data to one group of three wordlines, the ECC encoding circuit 1101 is arranged for employing threedifferent encoding engines to perform exclusive-OR (XOR) encodingoperations upon the data to be programed and thus generate and outputcorresponding partial parity check codes into the parity check codebuffer 1102 for buffering the partial parity check codes. The paritycheck code buffer 1102 is arranged for storing/buffering the partialparity check codes corresponding to the odd groups of word line data ina first buffer area, and for storing/buffering the partial parity checkcodes corresponding to the even groups of word line data in a secondbuffer area.

For instance, the ECC encoding circuit 1101 includes a first encodingengine, a second encoding engine, and a third encoding engine. Whenprogramming the data pages P1-P24 of word lines WL0-WL2, the ECCencoding circuit 1101 uses the first encoding engine to execute XORoperation upon data pages P1-P8 of the word line WL0 to generate a firstpartial parity check code, uses the second encoding engine to executeXOR operation upon data pages P9-P16 of the word line WL1 to generate asecond partial parity check code, and then uses the third encodingengine to execute XOR operation upon data pages P17-P24 of the word lineWL2 to generate a third partial parity check code. The ECC encodingcircuit 1101 respectively outputs the generated partial parity checkcodes to the parity check code buffer 1102, to buffer the generatedpartial parity check codes in the first buffer area. When programmingdata pages P1-P24 of the word lines WL3-WL5, the ECC encoding circuit1101 uses the first encoding engine to execute XOR operation upon datapages P1-P8 of the word line WL3 to generate another first partialparity check code, uses the second encoding engine to execute XORoperation upon data pages P9-P16 of the word line WL4 to generateanother second partial parity check code, and then uses the thirdencoding engine to execute XOR operation upon data pages P17-P24 of theword line WL5 to generate another third partial parity check code. TheECC encoding circuit 1101 respectively outputs the generated partialparity check codes to the parity check code buffer 1102, to buffer thegenerated partial parity check codes in the second buffer area.

Programming and encoding operations for other data pages are similar.That is, for data of the first, second, and third word lines of onegroup among the odd groups of word lines and for data of the first,second, and third word lines of one group among the even groups of wordlines, the ECC encoding circuit 1101 is arranged forperforming/executing different XOR operations to respectively generatecorresponding parity check codes. To write/program the correspondingparity check codes into appropriate storage locations of SLC block(s),the ECC encoding circuit 1101 is arranged to write/program thecorresponding parity check codes into last data pages (as shown by therectangle with slanted lines in FIG. 5) of last six word linesWL122-WL127 when programming data pages of the last six word linesWL122-WL127. For instance, when programming data pages of the word lineWL122 which is a third word line of one group among the odd groups ofword lines, the ECC encoding circuit 1101 programs/writes parity checkcodes corresponding to all third word lines among all odd groups of wordlines into the last/final data page of the word line WL122 wherein theparity check codes corresponding to all the third word lines are all thethird partial parity check codes generated by the third encoding enginefor the odd groups of word lines. For instance, when programming datapages of the word line WL123 which is a first word line of one groupamong the even groups of word lines, the ECC encoding circuit 1101programs/writes parity check codes corresponding to all first word linesamong all even groups of word lines into the last/final data page of theword line WL123 wherein the parity check codes corresponding to all thefirst word lines are all the first partial parity check codes generatedby the first encoding engine for the even groups of word lines. Forinstance, when programming data pages of the word line WL124 which is asecond word line of one group among the even groups of word lines, theECC encoding circuit 1101 programs/writes parity check codescorresponding to all second word lines among all even groups of wordlines into the last/final data page of the word line WL124 wherein theparity check codes corresponding to all the second word lines are allthe second partial parity check codes generated by the second encodingengine for the even groups of word lines.

For instance, when programming data pages of the word line WL125 whichis a third word line of the last group among the even groups of wordlines, the ECC encoding circuit 1101 programs/writes parity check codescorresponding to all third word lines among all even groups of wordlines into the last/final data page of the word line WL125 wherein theparity check codes corresponding to all the third word lines are all thethird partial parity check codes generated by the third encoding enginefor the even groups of word lines.

For instance, when programming data pages of the word line WL126 whichis a first word line of the last group among the odd groups of wordlines, the ECC encoding circuit 1101 programs/writes parity check codescorresponding to all first word lines among all odd groups of word linesinto the last/final data page of the word line WL126 wherein the paritycheck codes corresponding to all the first word lines are all the firstpartial parity check codes generated by the first encoding engine forthe odd groups of word lines.

For instance, when programming data pages of the word line WL127 whichis a second word line of the last group among the odd groups of wordlines, the ECC encoding circuit 1101 programs/writes parity check codescorresponding to all second word lines among all odd groups of wordlines into the last/final data page of the word line WL127 wherein theparity check codes corresponding to all the second word lines are allthe second partial parity check codes generated by the second encodingengine for the odd groups of word lines. Thus, data programming of oneSLC block is completed.

That is, when programming data into one SLC block, the flash memorycontroller 110 is arranged for sequentially classifies every (M) wordlines among all the word lines of the SLC block into one group of wordlines to generate odd groups of word lines and even groups of word linesand for respectively performing (M) times of different XOR encodingoperations upon each word line of each odd group and each word line ofeach even group to generate (M) partial parity check codes correspondingto each word line of the odd groups and (M) partial parity check codescorresponding to each word line of the even groups. The flash memorycontroller 110 then programs/writes the (M) partial parity check codescorresponding to each word line of the odd groups into the last/finaldata pages of last (M) word lines among the odd groups of word lines andprograms/writes the (M) partial parity check codes corresponding to eachword line of the even groups into the last/final data pages of last (M)word lines among the even groups of word lines. For example, M is equalto three in this embodiment but is not meant to be a limitation of theinvention.

The ECC encoding circuit 1101 as shown in the embodiment of FIG. 5 isarranged to perform XOR encoding operations which is capable ofcorrecting errors occurring in any one data page of one word line of oneSLC block. For example, when performing data programming of one SLCblock, if detecting data errors resulting from program fail andoccurring at a data page such as page P9 of word line WL1, the ECCencoding circuit 1101 can use other correct data pages P10-P16 of thesame word line WL1 and corresponding partial parity check code (s)generated by the second encoding engine when processing the word lineWL1 of the first group, to correct the errors occurring at the data pageP9.

For example, when performing data programming of one SLC block, ifdetecting data errors resulting from one word line open and occurring ata data page such as page P9 of word line WL1, the ECC encoding circuit1101 can also use other correct data pages P10-P16 of the same word lineWL1 and corresponding partial parity check code (s) generated by thesecond encoding engine when processing the word line WL1 of the firstgroup, to correct the errors occurring at the data page P9.

For example, when performing data programming of one SLC block, ifdetecting data errors resulting from two word line short and occurringat two data pages such as page P9 of word line WL1 and page P17 of wordline WL2, the ECC encoding circuit 1101 can use other correct data pagesP10-P16 of the word line WL1 and corresponding partial parity checkcode(s) generated by the second encoding engine when processing the wordline WL1 of the first group, to correct the errors occurring at the datapage P9. In addition, the ECC encoding circuit 1101 can use othercorrect data pages P18-P24 of the word line WL2 and correspondingpartial parity check code(s) generated by the third encoding engine whenprocessing the word line WL2 of the first group, to correct the errorsoccurring at the data page P17 of word line WL2.

If detecting data errors resulting from two word line short andoccurring at two data pages such as page P17 of word line WL2 and pageP1 of word line WL3, the ECC encoding circuit 1101 can use other correctdata pages P18-P24 of the word line WL2 and corresponding partial paritycheck code(s) generated by the third encoding engine when processing theword line WL2 of the first group, to correct the errors occurring at thedata page P17 of word line WL2. In addition, the ECC encoding circuit1101 can use other correct data pages P2-P8 of the word line WL3 andcorresponding partial parity check code(s) generated by the firstencoding engine when processing the word line WL3 of the second group,to correct the errors occurring at the data page P1 of word line WL3.

Thus, whether data page errors resulting from program fail, one wordline open or two word line short occur when one SLC block is programed,the ECC encoding circuit 1101 is able to correct the data page errorscorrespondingly. The internal copy operation of flash memory module 105for programming data from the above-mentioned SLC blocks into the TLCblock is similarly to the internal copy operation of the embodiment ofFIG. 3, and is not detailed for brevity.

Please refer to FIG. 6, which is a diagram illustrating a secondembodiment of flash memory controller 110 in FIG. 1 programming/writingthree groups of data into multiple SLC blocks 1051A-1051C within flashmemory module 105 and moving the data into the TLC block via theinternal copy operation to form a super block. The ECC encoding circuit1101 is arranged to separate data into odd groups of word line data andeven groups of word line data each time when performing programming ofSLC block(s), and is arranged to respectively store generated paritycheck codes at each last data page of the last three word lines of theodd groups and each last data page of the last three word lines of theeven groups. When module 105 performs programming of TLC block, as shownin FIG. 6 and marked by 605A, the parity check codes corresponding to afirst set of word lines are programed and stored to the MSB portion ofthe last data page of word line WL40, last data page of word line WL41,and LSB and CSB portions of the last data page of word line WL42 withinthe TLC block 1052. Specifically, parity check codes corresponding toodd groups of word lines of SLC block(s) belonging to the first set arestored at the MSB portion of the last data page of word line WL40 andLSB and CSB portions of the last data page of word line WL42. Paritycheck codes corresponding to even groups of word lines of SLC block(s)belonging to the first set are stored at the LSB, CSB, and MSB portionsof the last data page of word line WL41.

As marked by 605B, the parity check codes corresponding to a second setof word lines are programed and stored to the CSB and MSB portions ofthe last data page of word line WL83, last data page of word line WL84,and LSB portion of the last data page of word line WL85 within the TLCblock 1052. Specifically, for parity check codes corresponding to oddgroups of word lines of SLC block(s) belonging to the second set, allthe third partial parity check codes generated by the third encodingengine are stored at the CSB portion of the last data page of word lineWL83 of TLC block 1052; all the first partial parity check codesgenerated by the first encoding engine are stored at the MSB portion ofthe last data page of word line WL84 of TLC block 1052; all the secondpartial parity check codes generated by the second encoding engine arestored at the LSB portion of the last data page of word line WL85 of TLCblock 1052. Also, for parity check codes corresponding to even groups ofword lines of SLC block (s) belonging to the second set, all the firstpartial parity check codes generated by the first encoding engine arestored at the MSB portion of the last data page of word line WL83 of TLCblock 1052; all the second partial parity check codes generated by thesecond encoding engine are stored at the LSB portion of the last datapage of word line WL84 of TLC block 1052; all the third partial paritycheck codes generated by the third encoding engine are stored at the CSBportion of the last data page of word line WL84 of TLC block 1052.

As marked by 605C, the parity check codes corresponding to a third setof word lines are programed and stored to the last data pages (LSB, CSB,and MSB portions) of word lines WL126-WL127 of TLC block 1052.Specifically, for parity check codes corresponding to odd groups of wordlines of SLC block(s) belonging to the third set, all the third partialparity check codes generated by the third encoding engine are stored atthe LSB portion of the last data page of word line WL126 of TLC block1052; all the first partial parity check codes generated by the firstencoding engine are stored at the CSB portion of the last data page ofword line WL127 of TLC block 1052; all the second partial parity checkcodes generated by the second encoding engine are stored at the MSBportion of the last data page of word line WL127 of TLC block 1052.Also, for parity check codes corresponding to even groups of word linesof SLC block(s) belonging to the third set, all the first partial paritycheck codes generated by the first encoding engine are stored at the CSBportion of the last data page of word line WL126 of TLC block 1052; allthe second partial parity check codes generated by the second encodingengine are stored at the MSB portion of the last data page of word lineWL126 of TLC block 1052; all the third partial parity check codesgenerated by the third encoding engine are stored at the LSB portion ofthe last data page of word line WL127 of TLC block 1052.

Thus, when flash memory module 105 performs the internal copy operationto program data from the SLC blocks 1051A-1051C to the TLC block 1052,if detecting data errors resulting from two word line short andoccurring at two data pages (marked by 610) of word lines WL0 and WL1 ofthe super block, the flash memory module 105 is capable of correctingthe errors occurring at the LSB portion of the data page of word lineWL0 by using the first partial parity check codes stored at the CSBportion of the last data page of word line 42 of TLC block 1052 and datastored at LSB portions of the other data pages of word line WL0.Similarly, the flash memory module 105 is capable of correcting theerrors occurring at the CSB portion of the data page of word line WL0 byusing the second partial parity check codes stored at the MSB portion ofthe last data page of word line 42 of TLC block 1052 and data stored atCSB portions of the other data pages of word line WL0. Similarly, theflash memory module 105 is capable of correcting the errors occurring atthe MSB portion of the data page of word line WL0 by using the thirdpartial parity check codes stored at the MSB portion of the last datapage of word line 40 of TLC block 1052 and data stored at MSB portionsof the other data pages of word line WL0. Similarly, the flash memorymodule 105 is capable of correcting the errors occurring at the LSBportion of the data page of word line WL1 by using the first partialparity check codes stored at the LSB portion of the last data page ofword line 41 of TLC block 1052 and data stored at LSB portions of theother data pages of word line WL1. Similarly, the flash memory module105 is capable of correcting the errors occurring at the CSB portion ofthe data page of word line WL1 by using the second partial parity checkcodes stored at the CSB portion of the last data page of word line 41 ofTLC block 1052 and data stored at CSB portions of the other data pagesof word line WL1. Similarly, the flash memory module 105 is capable ofcorrecting the errors occurring at the MSB portion of the data page ofword line WL1 by using the third partial parity check codes stored atthe MSB portion of the last data page of word line 41 of TLC block 1052and data stored at MSB portions of the other data pages of word lineWL1.

If detecting data errors resulting from two word line short andoccurring at consecutive data pages (e.g., as marked by 615 and 620) ofany two consecutive word lines of the super block, the flash memorymodule 105 is capable of correcting errors by using corresponding paritycheck codes stored at each last data page of the last six data pages ofone SLC block belonging to each set. In addition, if detecting dataerrors resulting from one word line open or program fail and occurringat any single one data page of any one word line of the TLC block 1052(e.g. errors occurs at LSB, CSB, and MSB portions of the same data pageor at consecutive portions of two different data pages, the flash memorymodule 105 is also capable of correcting the errors by using thecorresponding parity check codes.

That is, according to the storage management mechanism for using flashmemory controller 110 to program/write three sets of data andcorresponding parity check codes into SLC blocks 1051A-1051C withinflash memory module 105, when the flash memory module 105 uses theinternal copy operation to sequentially program/write the data from SLCblocks 1051A-1051C into the TLC block to form a super block, the flashmemory module 105 can perform error correction by using the parity checkcodes stored at the SLC blocks 1051A-1051C if detecting the errorsresulting from one word line open, two word line short or program fail.

Further, the above-mentioned operations can be also applied for a flashmemory module including MLC blocks and QLC blocks. When a flash memorymodule including MLC blocks, the classifying operation is arranged forseparating data into two groups/sets, and the XOR encoding operation isimplemented by using two encoding engines; other operations are similarto those associated with the flash memory module structure with TLCblocks. Identically, when a flash memory module including QLC blocks,the classifying operation is arranged for separating data into fourgroups/sets, and the XOR encoding operation is implemented by using fourencoding engines; other operations are similar to those associated withthe flash memory module structure with TLC blocks.

Further, in other embodiments, after completing program of the pluralityof first blocks, the flash memory controller 110 can be arranged toperform an external copy operation to program the at least one secondblock; the external copy operation can be used for replacing theinternal copy operation. One of the advantages provided by the externalcopy operation is that it is easy to design or configure arandomizer/de-randomizer of a flash memory controller. Another advantageprovided by the external copy operation is that the data stored in thefirst blocks can be checked by the flash memory controller 115 againbefore storing to the second blocks.

Refer to FIG. 10. FIG. 10 is a device diagram of the flash memoryapparatus 1000 according to another embodiment of the invention. Theflash memory apparatus 1000 comprises the flash memory module 105 and aflash memory controller 115 which can be used for performing an externalcopy operation. The flash memory controller 115 comprises the paritycheck code buffer 1102, a randomizer (hardware circuit or software)1151A, an ECC encoding circuit 1152A, an ECC decoding circuit 1152B, anda de-randomizer (hardware circuit or software) 1151B. In thisembodiment, the randomizer 1151A is arranged to perform a randomizeoperation upon the data to be programed to the first block(s) accordingto randomizer seed rules of the first block such as SLC block, and isarranged to perform the randomize operation upon the data to beprogramed to the second block(s) according to randomizer seed rules ofthe second block such as TLC block, respectively. The ECC encodingcircuit 1151A having the operation similar to that of ECC encodingcircuit 1101 is arranged to perform ECC encoding operation upon data,and the ECC decoding circuit 1151B is arranged to perform ECC decodingoperation upon data read out from the flash memory module 105. Thede-randomizer 1151B is arranged to perform de-randomize operation uponthe data read out from the flash memory module 105.

In practice, the operation of controller 115 of FIG. 10 is similar tothat of controller 110 of FIG. 1, and the major difference is that thecontroller 115 is arranged to perform the external copy operationdifferent from the internal copy operation of controller 110. In thesuper block embodiment, the flash memory controller 115 is arranged forprogramming data into pages of different flash memory chips by employingan RAID-like (Redundant Array of Independent Disks-like) memorymanagement mechanism to reduce data error rate.

In one embodiment, to program one page data into one page of an SLCblock of one flash memory chip, the flash memory controller 115 mayemploy the randomizer 1151A to perform the randomize operation toprocess the one page data based on a seed of such page (or sector, orother seed unit) of the SLC block. For example, the seed of such page ofthe SLC block may be generated according to the physical address of thepage of the SLC block, e.g. a function of the physical address of thepage of the SLC block. The flash memory controller 115 may employ theECC encoding circuit 1152A to encode such page data to generate acorresponding parity check code and store such page data and the paritycheck code into such page of the SLC block. This can be regarded as afirst level ECC protection.

After the data have been completely programmed, the flash memorycontroller 115 can read out and decode three page data of three pages bythe ECC decoding circuit 1152B for correcting the read out data. Theflash memory controller 115 employ the de-randomizer 1151B to performthe de-randomize operation to process the three page data based on theseeds of the three pages of the SLC blocks respectively. The flashmemory controller 115 uses the de-randomized three pages of data togenerate data for storing in the TLC block (the three page data arelower, middle, and upper page data of the page data of TLC block). Therandomizer 1151A is arranged to randomize the three pages data of theTLC block based on the seeds of lower, middle, and upper pages of theTLC block respectively, e.g., using a first seed for the lower page, asecond seed for the middle page, and third seed for the upper page toperform randomize operation upon the three pages of data respectively.The first, second, and third seeds are generated according to thephysical storage address the lower, middle, and upper pages of the TLCblock respectively. In one embodiment, the ECC encoding circuit 1152A isarranged to generate another corresponding parity check code of suchpage data of a page of a TLC block and program the parity check code andsuch page data into the page of the TLC block of the flash memory chip.

In addition, the flash memory controller 115 can be arranged to performthe RAID-like memory management mechanism to program the above-mentioneddata into different pages of one flash memory chip for furtherprotection. This can be regarded as a second level ECC protection.

In the following embodiments, the flash memory controller 115 isarranged for programming data into different pages of one flash memorychip by employing an RAID-like (Redundant Array of IndependentDisks-like) memory management mechanism. Please note that the presentinvention is not limited to the following embodiments. In order toimprove the efficiency of data programming and reduce the data errorrate, the flash memory module 105 is designed to include multiplechannels (for example two channels in this embodiment but is notlimited). When a channel is used by the controller 115 to program acertain data page, the controller 115 can use another channel to programanother data page without waiting for the former channel. Each channelcorresponds to respective sequencer in the controller 115 andcorresponds to multiple flash memory chips (for example two chips inthis embodiment but is not limited). Thus, one channel can be to performdata programming simultaneously for different data pages of multipleflash memory chips without waiting for completion of one chip. Inaddition, each flash memory chip includes a folded design including twodifferent planes, and different data pages of two blocks respectivelylocated on the two different planes can be programmed simultaneouslywithout waiting for completion of data programming of one block whenprogramming data into one flash memory chip. One super block of theflash memory module 105 is composed by multiple data pages of multipleflash memory chips of multiple channels. In this embodiment, the flashmemory controller 115 is arranged to program data by super blocks. Itshould be noted that in other embodiments each flash memory chip may notcomprise the folded design, and one data page of one block is programmedwhen programming data into one flash memory chip. It is required to waitfor some times for programming data to other data pages.

For the flow of data programming, the programmed data in the SLC blocksare not copied and programmed to a TLC block from the SLC blocksdirectly. The flash memory controller 115 is arranged to use therandomizer 1151A to perform the randomize operation upon data based onthe seeds of SLC block and then use the ECC encoding circuit 1152A toperform ECC encoding upon the data, and to program the data andcorresponding parity check code into SLC blocks. In the next step, theflash memory controller 115 reads out the data stored by the SLC blocksand then uses the ECC decoding circuit 1152B to perform decoding uponthe read out data and uses the de-randomizer 1151B to perform thede-randomize operation upon the read data to generate the de-randomizeddata In the next step, the randomizer 1151A is arranged to perform therandomize operation upon the de-randomized data outputted by thede-randomizer 1151B based on the seeds of TLC block, for example,changing the randomizer seed according to the address of the TLC blockswhere the data will be finally programed to, e.g. physical storageaddress of the data. The ECC encoding circuit 1152A performs ECCencoding upon the randomized data outputted by the randomizer 1151A, andfinally the flash memory controller 115 programs the data and anotherparity check code into a TLC block.

To perform error correction protection for data programming of SLCblocks 1051A-1051C and data programming of the TLC block 1052, the flashmemory controller 115 is arranged for classifying the data into threegroups of data. It should be noted that the flash memory controller 115is arranged for classifying the data into two groups of data if themultiple-level-cell block for example includes MLC units which can beused for storing data of 2² states of 2 bits. The flash memorycontroller 115 is arranged for classifying the data into four groups ofdata if the multiple-level-cell block for example includes QLC unitswhich can be used for storing data of 2⁴ states of 4 bits. That is, theunits of multiple-level-cell block 1052 are used for storing informationof 2^(N) states of N bits wherein N is an integer which is equal to orgreater than 2, and the number of SLC blocks is designed as N. The flashmemory controller 115 is arranged to classify data to be programmed intoN groups of data to respectively program the data into N SLC blocks.

In this embodiment, after classifying the data as three groups of data,the flash memory controller 115 is arranged to execute a first SLCprogram to program the first group of data into the first SLC block1051A. The randomizer 1151A performs the randomize operation upon thefirst group of data based on the randomizer seed rules of SLC block, andthe ECC encoding circuit 1152A generates corresponding parity checkcodes, which can be buffered by the buffer 1102, and writes thecorresponding parity check codes into the first SLC block 1051A. In thisway, the data program of the SLC block 1051A is completed. Then, theflash memory controller 115 is arranged to execute the second SLCprogram to program the second group of data into the second SLC block1051B. The randomizer 1151A performs the randomize operation upon thesecond group of data based on randomizer seed rules of SLC block, andthe ECC encoding circuit 1152A generates corresponding parity checkcodes (buffered in the buffer 1102) and writes the corresponding paritycheck codes into the second SLC block 1051B. In this way, the dataprogram of the SLC block 1051B is completed. The flash memory controller115 then is arranged to execute the third SLC program to program thethird group of data into the third SLC block 1051C. The randomizer 1151Aperforms randomize operation upon the third group of data based on therandomizer seed rules of SLC block, and the ECC encoding circuit 1152Agenerates corresponding parity check codes (buffered in the buffer 1102)and writes the corresponding parity check codes into the third SLC block1051C. In this way, the data program of the third SLC block 1051C iscompleted.

When the flash memory controller 115 performs SLC program to write aparticular group of data into a particular SLC block or afterprogramming the particular SLC block has been completed, the flashmemory controller 115 is arranged to detect whether there are errors. Iferrors exist, for example program fail, the flash memory controller 115is arranged for programming the data again.

In the super block embodiment, the TLC block 1052 is composed by datapages of word lines of different flash memory chips of differentchannels. A data page of a word line of the TLC block 1052 for exampleincludes an upper page, a middle page, and a lower page. Multiple datapages of the (N)th word line of an SLC block may be configured to beprogramed/written into multiple upper pages of a word line of the TLCblock 1052. Multiple data pages of the (N+1)th word line of the SLCblock may be configured to be programed/written into multiple middlepages of the same word line of the TLC block 1052. Multiple data pagesof the (N+2)th word line of the SLC block may be configured to beprogramed/written into multiple lower pages of the same word line of theTLC block 1052. If all the three groups of data have been programed intothe TLC block 1052, the program operation for the super block iscompleted. Please note that the present invention is not limited to thesuper block programming operation. The external copy operation executedby the flash memory controller 115 is to read out the data previouslystored in the three SLC blocks 1051A, 1051B, and 1051C, to employ theECC decoding circuit 1152B to decode the data read out from the SLCblocks 1051A, 1051B, and 1051C, to employ the de-randomizer 1151B toperform the corresponding de-randomize operation upon the data outputtedby the ECC decoding circuit 1152B to generate the de-randomized data, toemploy the randomizer 1151A to perform the randomize operation upon thede-randomized data outputted by the de-randomizer 1151B based on theseeds of TLC block, and to employ the ECC encoding circuit 1152A toencode the randomized data outputted by the randomizer 1151A to generateanother parity check code. The flash memory controller 115 stores dataof a TLC block size with such corresponding parity check codes intolocations of upper, middle, and lower pages of the word line of the TLCblock 1052.

The ECC encoding circuit 1152A can adopt RAID-like RS (Reed Solomon)encoding operation, RAID-like XOR (exclusive-OR) encoding operation, BCHencoding operation, LDPC encoding operation or any other ECC encodingoperation. In one example, the ECC encoding circuit 1152A performs LDPCencoding operation upon a page of data and performs RAID-like encodingoperation upon a block or blocks of data for further protection. Theexample of one SLC programming executed by the flash memory controller115 of FIG. 10 to adopt/perform the RAID-like RS (Reed Solomon) encodingoperation to program a particular group of data into an SLC block offlash memory module 105 is similar/like to the example shown in FIG. 2.In addition, the example of one TLC programming executed by the flashmemory controller 115 of FIG. 10 to adopt/perform the RAID-like RS (ReedSolomon) encoding operation to form a supper block is similar/like tothe example shown in FIG. 4. The detailed description is not describedfor brevity.

The example of one SLC programming executed by the flash memorycontroller 115 of FIG. 10 to adopt/perform the RAID-like XOR(exclusive-OR) encoding operation to program a particular group of datainto an SLC block of flash memory module 105 is similar/like to theexample shown in FIG. 5. In addition, the example of one TLC programmingexecuted by the flash memory controller 115 of FIG. 10 to adopt/performthe RAID-like XOR (exclusive-OR) encoding operation to form a supperblock is similar/like to the example shown in FIG. 6. The detaileddescription is not described for brevity.

Further, the above-mentioned operations can be also applied for a flashmemory module including MLC blocks and QLC blocks. When a flash memorymodule including MLC blocks, the classifying operation is arranged forseparating data into two groups/sets, and the XOR encoding operation isimplemented by using two encoding engines; other operations are similarto those associated with the flash memory module structure with TLCblocks. Identically, when a flash memory module including QLC blocks,the classifying operation is arranged for separating data into fourgroups/sets, and the XOR encoding operation is implemented by using fourencoding engines; other operations are similar to those associated withthe flash memory module structure with TLC blocks. Further, it should benoted that the circuit locations of randomizer 1151A and ECC encodingcircuit 1152A can be swapped, and the circuit locations of de-randomizer1151B and ECC decoding circuit 1152B are be swapped correspondingly.

Regarding to ECC code overhead of the data storage mechanism mentionedabove, if two channels are employed for programming two memory chips andtwo blocks can be simultaneously programed based on the folded planedesign of each memory chip, for data programming of one SLC block, thereare (128) word lines in the SLC block and totally the SLC block has(8*128) data pages. Based on the data storage mechanism mentioned above,it is only required to use six data pages among the total (8*128) datapages to store corresponding parity check codes. The percentage of ECCcode overhead compared to the total data storage space, i.e. 6/(128*8),is smaller than one. That is, for data programming of SLC blocks and TLCblock(s), it is only necessary to use a data storage space of less than1% of the total data storage space for storing corresponding paritycheck codes of ECC operation. The utilization rate of a flash memorystorage space is higher compared to the conventional scheme.Additionally, if four channels are employed for programming four memorychips and two blocks can be simultaneously programed based on the foldedplane design of each memory chip, for data programming of one SLC block,there are (128) word lines in the SLC block and totally the SLC blockhas (4*4*2*128) data pages. Based on the data storage mechanismmentioned above, it is only required to use six data pages among thetotal (4*4*2*128) data pages to store corresponding parity check codes.The percentage of ECC code overhead compared to the total data storagespace, i.e. 6/(4*4*2*128), is decreased to be smaller and is almost0.15%. That is, for data programming of SLC blocks and TLC block(s), itis only necessary to use almost 0.15% of the total data storage spacefor storing corresponding parity check codes of ECC operation. Theutilization rate of a flash memory storage space can be much highercompared to the conventional scheme.

Additionally, in other embodiment, the flash memory module 105 may be a3D NAND-type flash memory module, and the flash memory controller 115can be arranged to program data into a block (may be used as asingle-level-cell block or as a multiple-level-cell block) of a 3DNAND-type flash memory module and can perform the above-mentionedexternal copy operation to program data the data read formsingle-level-cell blocks into a multiple-level-cell block of such 3DNAND-type flash memory module. Please refer to FIG. 11, which is adiagram of a 3D NAND-type flash memory. As shown in FIG. 11, the 3DNAND-type flash memory comprises multiple floating gate transistors1103, and the structure of 3D NAND-type flash memory is made up ofmultiple bit lines (e.g. BL1-BL3) and multiple word lines (e.g. WL0-WL2and WL4-WL6). One bit line can be also called one string. In FIG. 11,taking an example of a top plane, at least one data page constitutes allfloating gate transistors on the word line WL0, and another at least onedata page constitutes all floating gate transistors on the word lineWL1; another at least one data page constitutes all floating gatetransistors on the word line WL2, and other so on. Further, for example,the definition of one data page (logic data page) and the relationbetween such data page and word line WL0 may be different, and which maydepend on different data programming types adopted by the flash memory.Specifically, all floating gate transistors on the word line WL0correspond to one single logic data page when the flash memory adoptssingle-level cell (SLC) data programming. All floating gate transistorson the word line WL0 may correspond to two, three, or four logic datapages when the flash memory adopts multi-level cell (MLC) dataprogramming. For example, a triple-level cell (TLC) memory structuremeans that all floating gate transistors on the word line WL0 correspondto three logical data pages. Instead, a quad-level cell (QLC) memorystructure means that all floating gate transistors on the word line WL0correspond to four logical data pages. The description for the TLCmemory structure or QLC memory structure is not detailed here forbrevity. Additionally, for the program/erase operation of flash memorycontroller 115, one data page is a minimum data unit which is programedby the controller 115 into the module 105, and one block is a minimumdata unit which is erased by the controller 115; that is, the controller115 programs at least one data page for one data programming operation,and erases at least one block for one erase operation.

Please refer to FIG. 12, which is a schematic diagram illustratingfloating gate transistors 1103. As shown in FIG. 12, the gate andfloating gate of each floating gate transistor are disposed all aroundits source and drain, to improve the capability of channel sensing.

It should be noted that the examples of 3D NAND-type flash memory andfloating gate transistors 1103 shown in FIG. 11 and FIG. 12 are notmeant to be limitations of the present invention. In other embodiments,3D NAND-type flash memory may be designed or configured as differentstructures; for example, a portion of word lines may be mutuallyconnected. Also, the design or configuration of floating gate transistor1103 may be modified as different structures.

In some conventional 3D NAND-type flash memory structure, multiple wordlines are defined as or classified into a word line set, i.e. a set ofword lines, and such word line set correspond to or include a commoncontrol circuit. This inevitably causes that data errors occur at otherfloating gate transistors on the other word lines of such word line setwhen programming data to the floating gate transistors on a word line ofsuch word line set fails. In the embodiment, the word linesdisposed/positioned on the same plane is configured as or classifiedinto a word line set. Refer back to FIG. 11. Word lines WL0-WL3 areclassified into a first word line set, and word lines WL4-WL7 areclassified into a second word line set; and other so on. Refer to FIG.13, which is a diagram illustrating multiple word line sets in oneblock. As shown in FIG. 13, it is assumed that the block has forty-eight3D stacked planes, i.e. 48 word line sets. Each word line set has fourword lines and thus has all transistors on total one hundred andninety-two word lines. As shown in FIG. 13, the block has forty-eightword line sets which are represented by WL_G0-WL_G47. Additionally, inthis figure, the block is a TLC block. That is, floating gatetransistors on each word line can be used for storing data content ofthree data pages. As shown by FIG. 13, for example, floating gatetransistors on word line WL0 included by the word line set WL_G0 can beused for storing lower data page P0L, middle data page P0M, and upperdata page P0U. The floating gate transistors on word line WL1 includedby the word line set WL_G0 can be used for storing lower data page P1L,middle data page P1M, and upper data page P1U. The floating gatetransistors on word line WL2 included by the word line set WL_G0 can beused for storing lower data page P2L, middle data page P2M, and upperdata page P2U. The floating gate transistors on word line WL3 includedby the word line set WL_G0 can be used for storing lower data page P3L,middle data page P3M, and upper data page P3U. When the controller 115programs or writes data into the data pages of word line set WL_G0, thecontroller 115 is arranged for sequentially programs data into thefloating gate transistors on word lines WL0, WL1, WL2, and WL3. Even ifdata is successfully programed into word lines WL0 and WL1 butprogramming other data into word line WL2 fails (i.e. program fail),programming fail will occur at the word line set WL_G0 since the programfail of word line WL2 causes errors at the word lines WL0 and WL1.

Further, in some situations, even data has been successfully programedinto the word line set WL_G0, there is a possibility that the datacannot be read out from word line set WL_G0 or reading errors occur. Forinstance, the data cannot be read if one word line open occurs; all thedata of one word line set will become erroneous if one word line in suchword line set is open. Further, if two word lines in different word linesets are shorted (e.g. word lines WL3 and WL4 are shorted), then all thedata of two word line sets WL_G0 and WL_G1 cannot be read successfully.That is, the two word line sets WL_G0 and WL_G1 are equivalentlyshorted.

As mentioned above, since data errors may occur at one or two adjacentword line set(s) due to the program fail, word line open, and word lineshort when programming data into or reading data from a flash memory, tosolve the problems, in the embodiment a method/mechanism for accessingflash memory module 105 is provided. One of the advantages is that themethod/mechanism merely consumes less resource (i.e. occupies lessmemory space).

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

What is claimed is:
 1. A flash memory apparatus, comprising: a flashmemory module comprising a plurality of storage blocks, a cell of eachstorage block can be used for storing data of a first bit number or dataof a second bit number; and a flash memory controller, configured forclassifying data to be programmed into a plurality of groups of data,respectively executing error code encoding to generate a firstcorresponding parity check code to perform data writing of the first bitnumber to store the groups of data and the first corresponding paritycheck code into the flash memory module; wherein the flash memorycontroller is further arranged for reading out the groups of data fromthe flash memory module, executing error correction and de-randomizeoperation upon read out data to generate de-randomized data, executingrandomize operation upon the de-randomized data according to a set ofseeds to generate randomized data, performing error code encoding uponthe randomized data to generate a second corresponding parity checkcode, storing the randomized data and the second corresponding paritycheck code into the flash memory module by performing data writing ofthe second bit number; the first bit number is different from the secondbit number.
 2. The flash memory apparatus of claim 1, wherein the cellof a block corresponding to the second bit number is arranged forstoring data of 3 bits, and the second block is a triple-level-cellblock, and the flash memory controller is arranged for classifying thedata to be programmed into three groups of data to respectively programthe three groups of data into three single-level-cell blocks.
 3. Theflash memory apparatus of claim 1, wherein the flash memory controllercomprises: a decoding circuit, configured for executing the errorcorrection upon the read out data; a de-randomizer, coupled to thedecoding circuit, configured for performing the de-randomize operationupon the read out data to generate the de-randomized data; a randomizer,coupled to the de-randomizer, configured for executing the randomizeoperation upon the de-randomized data according to the set of seeds togenerate the randomized data; and an encoding circuit, coupled to therandomizer, configured for performing the error code encoding upon therandomized data to generate the second corresponding parity check code.4. A flash memory storage management method used for a flash memorymodule having a plurality of storage blocks, a cell of each storageblock can be used for storing data of a first bit number or data of asecond bit number, and the flash memory storage management methodcomprises: classifying data to be programmed into a plurality of groupsof data; respectively executing error code encoding to generate a firstcorresponding parity check code to perform data writing of the first bitnumber to store the groups of data and the first corresponding paritycheck code into the flash memory module; reading out the groups of datafrom the flash memory module; executing error correction andde-randomize operation upon read out data to generate de-randomizeddata; executing randomize operation upon the de-randomized dataaccording to a set of seeds to generate randomized data; performingerror code encoding upon the randomized data to generate a secondcorresponding parity check code; and storing the randomized data and thesecond corresponding parity check code into the flash memory module byperforming data writing of the second bit number; the first bit numberis different from the second bit number.
 5. The method of claim 4,wherein the cell of a block corresponding to the second bit number isarranged for storing data of 3 bits, and the second block is atriple-level-cell block, and the step of classifying the data to beprogrammed into the plurality of groups of data comprises: classifyingthe data to be programmed into three groups of data to respectivelyprogram the three groups of data into three single-level-cell blocks. 6.A flash memory controller connected to a flash memory module having aplurality of storage blocks, a cell of each storage block can be usedfor storing data of a first bit number or data of a second bit number,the flash memory controller being configured for classifying data to beprogrammed into a plurality of groups of data, respectively executingerror code encoding to generate a first corresponding parity check codeto perform data writing of the first bit number to store the groups ofdata and the first corresponding parity check code into the flash memorymodule, and the flash memory controller comprises: a decoding circuit,configured for executing error correction upon read out data which isread out by the flash memory controller from the flash memory module; ade-randomizer, coupled to the decoding circuit, configured forperforming a de-randomize operation upon the read out data to generatede-randomized data; a randomizer, coupled to the de-randomizer,configured for executing a randomize operation upon the de-randomizeddata according to a set of seeds to generate randomized data; and anencoding circuit, coupled to the randomizer, configured for performingthe error code encoding upon the randomized data to generate a secondcorresponding parity check code; wherein the flash memory controller isarranged for storing the randomized data and the second correspondingparity check code into the flash memory module by performing datawriting of the second bit number; the first bit number is different fromthe second bit number.
 7. The flash memory controller of claim 6,wherein the cell of a block corresponding to the second bit number isarranged for storing data of 3 bits, and the second block is atriple-level-cell block, and the flash memory controller is arranged forclassifying the data to be programmed into three groups of data torespectively program the three groups of data into threesingle-level-cell blocks.